Current Location: Home> Function Categories> filter_has_var

filter_has_var

Check whether the variable of the specified type exists
Name:filter_has_var
Category:Filter
Programming Language:php
One-line Description:Checks whether there are variables with the specified input type.

Definition and usage

filter_has_var() function checks whether there is a variable with the specified input type.

Return true if successful, otherwise return false.

Example

In this example, the input variable "name" is sent to the PHP page:

 <?php
if ( ! filter_has_var ( INPUT_GET , "name" ) )
 {
 echo ( "Input type does not exist" ) ;
 }
else
 {
 echo ( "Input type exists" ) ;
 }
?>

The output is similar:

 Input type exists

grammar

 filter_has_var ( type , variable )
parameter describe
type

Required. Specify the type to be inspected. Possible values:

  • INPUT_GET
  • INPUT_POST
  • INPUT_COOKIE
  • INPUT_SERVER
  • INPUT_ENV
variable Required. Specify the variables to be checked.
Similar Functions
Popular Articles